<?php

/**
 * UsuarioCredito form base class.
 *
 * @package    form
 * @subpackage usuario_credito
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseUsuarioCreditoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_usuario_credito' => new sfWidgetFormInputHidden(),
      'tp_finalidade'      => new sfWidgetFormInput(),
      'tp_garantia'        => new sfWidgetFormInput(),
      'vl_solicitado'      => new sfWidgetFormInput(),
      'vl_maximo'          => new sfWidgetFormInput(),
      'vl_parcela'         => new sfWidgetFormInput(),
      'dt_prazo'           => new sfWidgetFormDate(),
      'ds_carencia'        => new sfWidgetFormInput(),
      'id_dados_usuario'   => new sfWidgetFormDoctrineChoice(array('model' => 'DadosUsuario', 'add_empty' => false)),
      'created_at'         => new sfWidgetFormDateTime(),
      'updated_at'         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id_usuario_credito' => new sfValidatorDoctrineChoice(array('model' => 'UsuarioCredito', 'column' => 'id_usuario_credito', 'required' => false)),
      'tp_finalidade'      => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'tp_garantia'        => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      'vl_solicitado'      => new sfValidatorNumber(array('required' => false)),
      'vl_maximo'          => new sfValidatorNumber(array('required' => false)),
      'vl_parcela'         => new sfValidatorNumber(array('required' => false)),
      'dt_prazo'           => new sfValidatorDate(array('required' => false)),
      'ds_carencia'        => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'id_dados_usuario'   => new sfValidatorDoctrineChoice(array('model' => 'DadosUsuario')),
      'created_at'         => new sfValidatorDateTime(array('required' => false)),
      'updated_at'         => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('usuario_credito[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'UsuarioCredito';
  }

}
